let proxyObj = {}
proxyObj['/'] = {
    //websocket
    ws: false,
    //目标地址
    target: 'http://localhost:8081',
//发送请求头host会被设置target
    changeOrigin: true,
//不重写请求地址
    pathReWrite: {
        '^/': '/'
    }
}

proxyObj['/ws'] = {
    //websocket
    ws: true,
    //目标地址
    target: 'http://localhost:8081',
}


module.exports = {
    chainWebpack(config){
        //修改htmlWebpackPlugin
        config.plugin('html').tap(args => {
          args[0].title = '校园运动健康平台';
          return args;
        })
      },
    devServer: {
        host: 'localhost',
        port: 8080,
        proxy: proxyObj
    }
}